{% extends 'fruitShop/base_goods.html' %}

{% block body_content_inner %}
{% load static %}
	<div class="navbar_con">
		<div class="navbar clearfix">
			<div class="subnav_con fl">
				<h1>全部商品分类</h1>
				<span></span>
				<ul class="subnav">
					{% for cate in categories %}
					<li><a href="{% url 'fruitShop:list' cate.id 1 1 %}" class="{{ cate.className }}">{{ cate.title }}</a></li>
                    {% endfor %}
				</ul>
			</div>
			<ul class="navlist fl">
				<li><a href="">首页</a></li>
				<li class="interval">|</li>
				<li><a href="">手机生鲜</a></li>
				<li class="interval">|</li>
				<li><a href="">抽奖</a></li>
			</ul>
		</div>
	</div>

	<div class="breadcrumb">
		<a href="/">全部分类</a>
		<span>></span>
    搜索 '{{ query }}'
	</div>



	<div class="main_wrap clearfix">

		<div class="">
			<div class="sort_bar">
				<a href="" class="active">默认</a>
			</div>
{% if page.object_list %}
			<ul class="goods_type_list clearfix">
                {% for good in page.object_list %}
				<li>
					<a href="{% url 'fruitShop:detail' good.object.id %}"><img src="{% static 'fruitShop/upload_images/' %}{{ good.object.picture }}"></a>
					<h4><a href="{% url 'fruitShop:detail' good.object.id %}">{{ good.object.name }}</a></h4>
					<div class="operate">
						<span class="prize">￥{{ good.object.price }}</span>
						<span class="unit">{{ good.object.price }}/{{ good.object.unit }}</span>
						<a href="javascript:;" onclick="addCart({{ good.object.id }})" class="add_goods" title="加入购物车"></a>
					</div>
				</li>
                {% endfor %}
			</ul>

			<div class="pagenation">
                {% if page.has_previous or page.has_next %}

                    {% if page.has_previous %}
				        <a href="?q={{ query }}&amp;page={{ page.previous_page_number }}"><上一页</a>
                        {% endif %}

                    {% for p_index in page.paginator.page_range %}
                        {% if p_index == page.number %}
                            <a href="javascript:;" class="active">{{ p_index }}</a>
                        {% else %}
                        <a href="?q={{ query }}&amp;page={{ p_index }}">{{ p_index }}</a>
                        {% endif %}
                {% endfor %}

            {% if page.has_next %}
                <a href="?q={{ query }}&amp;page={{ page.next_page_number }}">>下一页</a>
            {% endif %}

                {% endif %}
			</div>
    {% else %}
   <h2 style="text-align: center;color: red;font-size: 30px"> 没有搜到啊</h2>
        {% endif %}
		</div>
	</div>


{% endblock %}
{% block js %}

{% endblock %}